/*
 * Copyright (c) 2018-2999 九五云信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 */

package com.yami.shop.user.comment.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yami.shop.bean.param.CustomerReqParam;
import com.yami.shop.bean.param.MemberGrowthDetailParam;
import com.yami.shop.bean.param.MemberGrowthReqParam;
import com.yami.shop.user.comment.model.UserLevelLog;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author LGH
 * @date 2020-02-26 16:03:14
 */
public interface UserLevelLogMapper extends BaseMapper<UserLevelLog> {

    Page<UserLevelLog> getPage(Page<UserLevelLog> page, @Param("userLevelLog") UserLevelLog userLevelLog);

    Integer getMaxLevelByUserId(@Param("userId") String userId);

    Integer countGrowthMember(@Param("param") CustomerReqParam param);

    List<MemberGrowthDetailParam> countGrowthMemberByParam(@Param("param") MemberGrowthReqParam param);

    List<String> listUserIdByRechargeNum(@Param("isPayed") Integer isPayed,
                                         @Param("startDate") Date startDate,
                                         @Param("endDate") Date endDate,
                                         @Param("minNum") Long minNum,
                                         @Param("maxNum") Long maxNum);

    List<String> listUserIdByEarliestRechargeTime(@Param("isPayed") Integer isPayed,
                                         @Param("startDate") Date startDate,
                                         @Param("endDate") Date endDate);

    UserLevelLog getMaxCrtTimeByUserId(@Param("userId") String userId);
}
